import type { ListResponseType } from '@/api/global.type';

// 设置AI分析模式
export interface SetAIASConfigParamsType {
	isAutoAI: number;
}

// 获取教室自动分析列表
export interface GetAiAutomaticAnalysisParamsType {
	businessType: number;
}

export type GetAiAutomaticAnalysisResponseType = string[];

// 批量添加自动分析配置信息
export interface BatchAddAiAutomaticAnalysisParamsType {
	businessType: number;
	businessCodes: string[];
}

// 查询课堂列表（包含AI分析状态）
export interface GetLessonPageForManageParamsType {
	termCode: string;
	academyCode: string;
	searchValue: string;
	campusCode: string;
	buildingCode: string;
	roomCode: string;
	beginTime: number | undefined;
	endTime: number | undefined;
	aiLessonTaskStatus: number[] | null;
	pageNum: number;
	pageSize: number;
	sort: string;
}

export interface LessonItemType {
	academyCode: string;
	academyName: string;
	aiStatus: number;
	beginTime: number;
	courseCode: string;
	endTime: number;
	id: number;
	lastAiTime: number;
	lessonCode: string;
	name: string;
	resultProcessStatus: number;
	roomCode: string;
	roomName: string;
	subjectCode: string;
	teacherCodes: string;
	teacherNames: string;
}

export type GetLessonPageForManageResponseType = ListResponseType<LessonItemType>;

// 开启AI分析任务
export interface OpenAILessonTaskParamsType {
	lessonCodeList: string[];
	type: string | undefined;
	llmNodeTypes?: string[];
}

// 查询指定课堂AI分析任务进度详情
export type AILessonTaskProgressKeyType =
	| 'audioTask'
	| 'behaviorRecognitionResp'
	| 'llmTask'
	| 'pptTask'
	| 'resultProcess'
	| 'scoreCal';
export interface AILessonTaskProgressItemType {
	bgTime: number;
	edTime: number;
	order: number;
	msg: string;
	name: string;
	serverName?: string;
	status: number;
	type?: string;
	taskList?: AILessonTaskProgressItemType[];
}
export type GetAILessonTaskProgressResponseType = Record<
	AILessonTaskProgressKeyType,
	AILessonTaskProgressItemType
>;

// 查询课堂或直播活动的录制任务的详情-响应类型
export interface DeviceType {
	id: number;
	name: string;
	purpose: number;
	deviceTypeId: number;
}
export interface FileType {
	playIp: string;
	filesize: number;
	type: number;
	url: string;
	localUrl: string;
	duration: number;
	recordId: string;
	result: number;
	filename: string;
	width: number;
	height: number;
	id: string;
	fbeginTimes: number;
	fendTimes: number;
	index?: number;
}
export interface RecordTaskType {
	result: number;
	streamId: string;
	callback: string;
	startTime: number;
	endTime: number;
	id: string;
	type: number;
	serverId: string;
	status: number;
	device: DeviceType;
	files: FileType[];
	purpose?: number;
	sourceCode?: string;
	sourceName?: string;
	isCovered?: boolean;
	isDelete?: boolean;
}
export type GetResourceByLessonCodeResponseType = RecordTaskType[];

// 教室监管查询
export interface GetCheckRoomListParamsType {
	buildingCode: string;
	buildingFloorNo: string;
	type: number | null;
	name: string;
	roomTypeId: string;
}

export interface CheckRoomItem {
	code: string;
	buildingFloorNo: number;
	id: string;
	liveStatus: number;
	name: string;
	normal: boolean;
	recordingStatus: number;
	roomTypeName: string;
	use: boolean;
}

export interface GetCheckRoomListResponseTypeItem {
	name: string;
	code: string;
	roomList: CheckRoomItem[];
}

export type GetCheckRoomListResponseType = GetCheckRoomListResponseTypeItem[];
